package com.ikaros.emnus;

import lombok.Data;
import lombok.Getter;

/**
 * Created by Ikaros on 2017/9/29.
 */
@Getter
public enum SexEnum implements CodeEnum{
    SECRECY(0,"保密"),
    BOY(1,"男"),
    GIRL(2,"女");
    private Integer code;
    private String msg;

    SexEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static SexEnum getSexEnum(int index){
        for (SexEnum code : SexEnum.values()) {
            if (code.getCode()==index){
                return  code;
            }
        }
        return null;
    }
}
